import 'package:safetymonitor/app/core/core.dart';
import 'package:safetymonitor/generated/assets.dart';

///特殊作业-带图标的标题
///[title] 标题
///[titleRightWidget] 右侧控件
///[checkbox] 复选框
/// demo:
/// ``` dart
/// CustomIconTitleView(
///   title: '标题',
/// );
/// ```
class CustomIconTitleView extends StatelessWidget {
  const CustomIconTitleView({
    required this.title,
    this.titleColor=const Color(0xff262F38),
    this.titleRightWidget,
    this.isShowTitleRightWidget,
    this.checkbox,
    this.leftIcon,
    super.key,
  });

  final String title;
  final Color? titleColor;
  final Widget? titleRightWidget;
  final Widget? isShowTitleRightWidget;
  final Widget? checkbox;
  final Widget? leftIcon;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: 17.w, vertical: 12.w),
      child: Row(
        children: [
          checkbox ?? Container(),
          checkbox != null ? AppGaps.hGap10 : Container(),
          leftIcon??  SvgPicture.asset(
            Assets.svgIconBlueStar,
            width: 12.w,
            height: 12.w,
          ),

          AppGaps.hGap6,
          Expanded(
              child: Text(
            title,
            style: TextStyle(color:titleColor , height: 1.2, fontWeight: FontWeight.w500, fontSize: 14.sp),
          )),
          isShowTitleRightWidget ?? Container(),
          titleRightWidget ?? Container(),
        ],
      ),
    );
  }
}
